package com.easpeed.elevator.bean

import android.os.Parcel
import android.os.Parcelable
import java.util.UUID

/**
 * Created by bigyu on 2024/11/12 13:17
 * com.easpeed.elevator.bean
 */
class RouteBean() : Parcelable {

    var routeId: String? = ""

    var strength: String? = ""
    var distance: String? = ""


    constructor(strength: String?, distance: String?) : this() {
        this.strength = strength
        this.distance = distance
    }



    /**
     * DataConsts
     */
    var routeType: String? = ""
    var routeTypeId: String? = ""


    var lat: String? = "0"
    var lng: String? = "0"


    var lineId: String? = ""
    var lineName: String? = ""


    var opticalId: String? = ""
    var opticalName: String? = ""


    //光纤编号
    var codeMark: String? = ""

    var addressRemark: String? = ""
    var routeRemark: String? = ""

    var imagePath = arrayListOf<String>()

    constructor(parcel: Parcel) : this() {
        strength = parcel.readString()
        distance = parcel.readString()
        routeId = parcel.readString()
        routeType = parcel.readString()
        routeTypeId = parcel.readString()
        lat = parcel.readString()
        lng = parcel.readString()
        lineId = parcel.readString()
        lineName = parcel.readString()
        opticalId = parcel.readString()
        opticalName = parcel.readString()
        codeMark = parcel.readString()
        addressRemark = parcel.readString()
        routeRemark = parcel.readString()
    }

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as RouteBean

        return routeId == other.routeId
    }

    override fun hashCode(): Int {
        return routeId?.hashCode() ?: 0
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(strength)
        parcel.writeString(distance)
        parcel.writeString(routeId)
        parcel.writeString(routeType)
        parcel.writeString(routeTypeId)
        parcel.writeString(lat)
        parcel.writeString(lng)
        parcel.writeString(lineId)
        parcel.writeString(lineName)
        parcel.writeString(opticalId)
        parcel.writeString(opticalName)
        parcel.writeString(codeMark)
        parcel.writeString(addressRemark)
        parcel.writeString(routeRemark)
    }

    override fun describeContents(): Int {
        return 0
    }

    override fun toString(): String {
        return "RouteBean(strength=$strength, distance=$distance, routeId=$routeId, routeType=$routeType, routeTypeId=$routeTypeId, lat=$lat, lng=$lng, lineId=$lineId, lineName=$lineName, opticalId=$opticalId, opticalName=$opticalName, codeMark=$codeMark, addressRemark=$addressRemark, routeRemark=$routeRemark, imagePath=$imagePath)"
    }

    companion object CREATOR : Parcelable.Creator<RouteBean> {
        override fun createFromParcel(parcel: Parcel): RouteBean {
            return RouteBean(parcel)
        }

        override fun newArray(size: Int): Array<RouteBean?> {
            return arrayOfNulls(size)
        }
    }


}